//layout布局中所用到的  仓库变量
const state = {
    //需要拿到路由导航的第一个首页路由
    defaultActive: sessionStorage.getItem("defaultActive")||"/home",//存放默认的样式
    isCollapse: false, //侧边栏是否展开
}
const actions = {
    changCollapse(context: any, arg: boolean) {
        // console.log(context,arg)
        context.commit('CHANGCOLLAPSE', arg)
    }, changDefaultActive(context: any, arg: boolean) {
        // console.log(context,arg)
        context.commit('CHANGDEFAULTACTIVE', arg)
    },
}
const mutations = {
    CHANGCOLLAPSE(state: any, arg: any) {
        state.isCollapse = arg
    },
    //修改活动路由
    CHANGDEFAULTACTIVE(state: any, arg: any) {
        state.defaultActive = arg
        sessionStorage.setItem('defaultActive',arg)
    }
}

export default {
    namespace: true,
    state,
    actions,
    mutations
}